<template>
	<view class="index" >
		<Teacher v-if="isteacher"></Teacher>
		<Home ref="homePage" v-else></Home>
	</view>	
</template>

<script>
	import { getToken } from '@/utils/auth'
	import { getinfo } from '@/utils/auth5'
	export default {
		data() {
			return {
				isteacher: false
			}
		},
		onShow() {
			this.Initialize()
		},
		beforeCreate(){
			console.log("getinfo()",getinfo())
			
			let url = window.location.href
			if(url.indexOf('ticket')!=-1){
				let ticket = url.split("ticket=")[1].split("&")[0]
				this.$store.state.user.ticket = ticket
				this.$store.state.user.isApp = 1
				this.$tab.reLaunch('/pages/loginwait')
			}
		},
		methods: {
			Initialize(){
				this.$refs.homePage && this.$refs.homePage.handleShow()
			}
		}
	}
</script>

<style>
	.index{
		background-color: #f1f1f1;
		width: 100vw;
		/* height: 94.66vh; */
		height: calc(100vh - 50px - env(safe-area-inset-bottom));
	}
</style>